Imports System.IO
Imports System.Drawing
Imports MetodosComuns
Imports System.Drawing.Imaging
Imports EnhancedFileUpload

Partial Class showThumbImage
  Inherits System.Web.UI.Page

  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim strNomeImagem As String = Request.QueryString("nome")
    Dim strDir As String = HttpContext.Current.Server.MapPath("~/videos/thumb/" & strNomeImagem)
    If strDir IsNot Nothing AndAlso strNomeImagem IsNot Nothing AndAlso File.Exists(strDir) Then
      Dim bmpImage As Bitmap = Bitmap.FromFile(strDir)
      Response.ContentType = "image/jpeg"
      Response.AppendHeader("Pragma", "no-cache")
      Response.CacheControl = "Private"
      Response.Expires = 0
      Response.CacheControl = "no-cache"
      Response.Cache.SetNoStore()
      bmpImage.Save(Response.OutputStream, ImageFormat.Jpeg)
      bmpImage.Dispose()
      Response.End()
    End If
  End Sub

End Class
